<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>JSDoc: Class: PageViewport</title>

    <script src="scripts/prettify/prettify.js"> </script>
    <script src="scripts/prettify/lang-css.js"> </script>
    <!--[if lt IE 9]>
      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>

<body>

<div id="main">

    <h1 class="page-title">Class: PageViewport</h1>

    



<section>

<header>
    <h2>
        <span class="ancestors"><a href="PDFJS.html">PDFJS</a>.</span>
    
    PageViewport
    </h2>
    
</header>

<article>
    <div class="container-overview">
    

    
        
<dt>
    <h4 class="name" id="PageViewport"><span class="type-signature"></span>new PageViewport<span class="signature">()</span><span class="type-signature"></span></h4>

    
</dt>
<dd>

    
    <div class="description">
        PDF page viewport created based on scale, rotation and offset.
    </div>
    

    

    

    

    
<dl class="details">
    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="util.js.html">shared/util.js</a>, <a href="util.js.html#line792">line 792</a>
    </li></ul></dd>
    

    

    

    
</dl>


    

    

    

    

    

    

    
</dd>

    
    </div>

    

    

    

    

     

    

    

    
        <h3 class="subsection-title">Methods</h3>

        <dl>
            
<dt>
    <h4 class="name" id="clone"><span class="type-signature"></span>clone<span class="signature">(args)</span><span class="type-signature"> &rarr; {<a href="PDFJS.PageViewport.html">PDFJS.PageViewport</a>}</span></h4>

    
</dt>
<dd>

    
    <div class="description">
        Clones viewport with additional properties.
    </div>
    

    

    

    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>args</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            

            

            <td class="description last">(optional) If specified, may contain the 'scale' or
'rotation' properties to override the corresponding properties in
the cloned viewport.</td>
        </tr>

    
    </tbody>
</table>
    

    
<dl class="details">
    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="util.js.html">shared/util.js</a>, <a href="util.js.html#line874">line 874</a>
    </li></ul></dd>
    

    

    

    
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    Cloned viewport.
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="PDFJS.PageViewport.html">PDFJS.PageViewport</a></span>


    </dd>
</dl>

        

    
</dd>

        
            
<dt>
    <h4 class="name" id="convertToPdfPoint"><span class="type-signature"></span>convertToPdfPoint<span class="signature">(x, y)</span><span class="type-signature"> &rarr; {Object}</span></h4>

    
</dt>
<dd>

    
    <div class="description">
        Converts viewport coordinates to the PDF location. For examples, useful
for converting canvas pixel location into PDF one.
    </div>
    

    

    

    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>x</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>


            
            </td>

            

            

            <td class="description last">X coordinate.</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>y</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>


            
            </td>

            

            

            <td class="description last">Y coordinate.</td>
        </tr>

    
    </tbody>
</table>
    

    
<dl class="details">
    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="util.js.html">shared/util.js</a>, <a href="util.js.html#line916">line 916</a>
    </li></ul></dd>
    

    

    
    <dt class="tag-see">See:</dt>
    <dd class="tag-see">
        <ul>
            <li>convertToViewportPoint</li>
        </ul>
    </dd>
    

    
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    Object that contains 'x' and 'y' properties of the
point in the PDF coordinate space.
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Object</span>


    </dd>
</dl>

        

    
</dd>

        
            
<dt>
    <h4 class="name" id="convertToViewportPoint"><span class="type-signature"></span>convertToViewportPoint<span class="signature">(x, y)</span><span class="type-signature"> &rarr; {Object}</span></h4>

    
</dt>
<dd>

    
    <div class="description">
        Converts PDF point to the viewport coordinates. For examples, useful for
converting PDF location into canvas pixel coordinates.
    </div>
    

    

    

    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>x</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>


            
            </td>

            

            

            <td class="description last">X coordinate.</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>y</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>


            
            </td>

            

            

            <td class="description last">Y coordinate.</td>
        </tr>

    
    </tbody>
</table>
    

    
<dl class="details">
    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="util.js.html">shared/util.js</a>, <a href="util.js.html#line891">line 891</a>
    </li></ul></dd>
    

    

    
    <dt class="tag-see">See:</dt>
    <dd class="tag-see">
        <ul>
            <li>convertToPdfPoint</li>
        
            <li>convertToViewportRectangle</li>
        </ul>
    </dd>
    

    
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    Object that contains 'x' and 'y' properties of the
point in the viewport coordinate space.
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Object</span>


    </dd>
</dl>

        

    
</dd>

        
            
<dt>
    <h4 class="name" id="convertToViewportRectangle"><span class="type-signature"></span>convertToViewportRectangle<span class="signature">(rect)</span><span class="type-signature"> &rarr; {Array}</span></h4>

    
</dt>
<dd>

    
    <div class="description">
        Converts PDF rectangle to the viewport coordinates.
    </div>
    

    

    

    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>rect</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array</span>


            
            </td>

            

            

            <td class="description last">xMin, yMin, xMax and yMax coordinates.</td>
        </tr>

    
    </tbody>
</table>
    

    
<dl class="details">
    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="util.js.html">shared/util.js</a>, <a href="util.js.html#line901">line 901</a>
    </li></ul></dd>
    

    

    
    <dt class="tag-see">See:</dt>
    <dd class="tag-see">
        <ul>
            <li>convertToViewportPoint</li>
        </ul>
    </dd>
    

    
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    Contains corresponding coordinates of the rectangle
in the viewport coordinate space.
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Array</span>


    </dd>
</dl>

        

    
</dd>

        </dl>
    

    

    
</article>

</section>




</div>

<nav>
    <h2><a href="index.html">Index</a></h2><h3>Externals</h3><ul><li><a href="external-Promise.html">Promise</a></li></ul><h3>Classes</h3><ul><li><a href="PDFDataRangeTransport.html">PDFDataRangeTransport</a></li><li><a href="PDFDocumentLoadingTask.html">PDFDocumentLoadingTask</a></li><li><a href="PDFDocumentProxy.html">PDFDocumentProxy</a></li><li><a href="PDFJS.html">PDFJS</a></li><li><a href="PDFJS.PageViewport.html">PageViewport</a></li><li><a href="PDFPageProxy.html">PDFPageProxy</a></li><li><a href="RenderTask.html">RenderTask</a></li></ul><h3><a href="global.html">Global</a></h3>
</nav>

<br clear="both">

<footer>
    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha9</a> on Thu Mar 19 2015 18:44:53 GMT+0000 (GMT Standard Time)
</footer>

<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>